package com.senior.sendmessage.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.senior.sendmessage.entity.Person;
import com.senior.sendmessage.event.EventDemo;
import com.senior.sendmessage.mapper.PersonMapper;
import com.senior.sendmessage.service.PersonService;
import lombok.RequiredArgsConstructor;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.stereotype.Service;

/**
 * (Person)表服务实现类
 *
 * @author Baijl
 * @since 2021-06-22 11:17:06
 */
@Service
@RequiredArgsConstructor
public class PersonServiceImpl extends ServiceImpl<PersonMapper, Person> implements PersonService {
    private final PersonMapper personMapper;
    private final ApplicationEventPublisher applicationEventPublisher;

    @Override
    public void listen() {
        applicationEventPublisher.publishEvent(new EventDemo("hhh","ggg"));
    }
}
